﻿using System;
using System.Collections.Generic;
using System.Text;
using Autofac;
using System.Reflection;
using System.Linq;
using AutofacModule = Autofac.Module;

namespace Vav.Data.DataAccess
{
    public class DataAccessModule: AutofacModule
    {
        protected override void Load(ContainerBuilder builder)
        {
            //类型多了之后可以用这个方法
            var dataAccessTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Name.EndsWith("DataAccess")).ToArray();
            builder.RegisterTypes(dataAccessTypes);
            base.Load(builder);
        }
    }
}
